package com.kaka.bus.adapter;

import android.app.Activity;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.kaka.bus.R;
import com.kaka.bus.bean.DrainProductBean;
import com.kaka.bus.bean.Rolling;

import java.util.List;

public class MainAdvertisingAdapter extends BaseQuickAdapter<Rolling.AdBannerBean, BaseViewHolder> {
    private Activity mActivity;

    public MainAdvertisingAdapter(Activity activity, int layoutResId, @Nullable List<Rolling.AdBannerBean> data) {
        super(layoutResId, data);
        this.mActivity = activity;
    }

    @Override
    protected void convert(BaseViewHolder helper, Rolling.AdBannerBean item) {
        ImageView imageView = helper.getView(R.id.img_src);
        Glide.with(mActivity).load(item.getUrl()).error(R.drawable.icon_kakadef).into(imageView);

    }
}
